// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1056

//#define COMPILE
#ifdef COMPILE

#include <fstream>
using namespace std;

int n;
int m;

void input() {
	ifstream in("input.txt");
	in >> n >> m;
	if (n > m) {
		int o = n;
		n = m;
		m = n;
	}
	in.close();
}

void output() {
	ofstream out("output.txt");
	int count = 0;
	for (int i = n; i <= m; i++) {
		if (((i % 10) % 3 == 0) && (i % 10 > 0)){
			count++;
			out << i << endl;
		}
	}
	out << count << endl;
	out.close();
}

int main() {
	input();

	output();

	return 0;
}
#endif
